package com.chixing.day09.InnerClass;

import com.chixing.day09.OrderSystemW.GoveOrder;
import com.chixing.day09.OrderSystemW.Order;
import com.chixing.day09.OrderSystemW.OrderApi;
import com.chixing.day09.OrderSystemW.PersonalOrder;

public class InnerTest {
    public static void main(String[] args) {
        Student stu = new Student();
        stu.stuAge = 20;
        stu.study();

        Student.StudentAddress address1 = null;
        Student.StudentAddress address2 = stu.new StudentAddress();


        // 成员内部类
        Outer outer = new Outer();
        Outer.Inner inner1 = outer.new Inner();  // 外部类对象.内部类对象

        // 静态内部类
        Outer.Inner2 inner2 = new Outer.Inner2();// new 外部类名.内部类名

        Order o1 = new PersonalOrder();

        OrderApi orderApi1 = new PersonalOrder();// 创建接口对象： ---- 子类对象 PersonalOrder { 实现接口中的方法}

        OrderApi orderApi2 = new GoveOrder();  // 创建接口对象： ---- 子类对象 GoveOrder { 实现接口中的方法}

        // 创建接口对象： ---- 子类对象 【匿名对象】 { 实现接口中的方法}
        /*
             new OrderApi(){
                public Order orderClone() {
                    return null;
                }
            }
         */
        OrderApi orderApi3 = new OrderApi() {
            @Override
            public Order orderClone() {
                return null;
            }
        };

        orderProcess(orderApi1);
        orderProcess(orderApi2);
        orderProcess(new OrderApi(){
            @Override
            public Order orderClone() {
                return null;
            }
        });
    }


    public static void orderProcess(OrderApi orderApi) {

    }
}
